package com.ayz.gateway.core.context.context;


import com.ayz.gateway.core.context.config.Configuration;
import com.ayz.gateway.core.context.defaults.DefaultApiGatewayContextFactory;
import com.ayz.gateway.core.core.Netty.NettyServerConfig;
import com.ayz.gateway.core.datasource.DatasourceFactory;
import com.ayz.gateway.core.session.processor.RpcPostProcessorRegistry;
import lombok.Data;

/**
 * @ClassName ApiGatewayContextFactoryBuilder
 * @Description TODO: ApiGatewayContext的构建器
 * @Author 快乐的星球
 * @Date 2023/5/7 12:06
 * @Version 1.0
 **/
@Data
public class ApiGatewayContextFactoryBuilder {

    private final ApiGatewayContextFactory contextFactory=new DefaultApiGatewayContextFactory();
    public ApiGatewayContext build(Configuration configuration, NettyServerConfig serverConfig,
                                   DatasourceFactory datasourceFactory,
                                   RpcPostProcessorRegistry postProcessorRegistry){
        return contextFactory.openContext(configuration,serverConfig, datasourceFactory, postProcessorRegistry);
    }
}
